function getUrl() {
    //设置背景墙和用户头像
    var user = JSON.parse(sessionStorage.getItem('user'));
    var imgUrls = '';
    var html = '';
    if (user) {
        $('.myBg').css('background-image', 'url("' + user.coverImgUrl + '")');
        $('#headImg').attr('src', user.headImgUrl);
    }
    //*****************************************
    //*************回显*************************
    if (user) {
        var id = user.id;
        $.get("/users/getPictures/" + id, function (data) {
            if (data) {
                imgUrls = data;
                console.log(imgUrls);
                var split = data.split(";");
                console.log(split);
                $.each(split, function (index, item) {
                    if (item) {
                        html += "<div class='col-3 rect'><img src='" + item + "'/></div>";
                    }
                })
                $('#jiushi').prepend(html);
            }
        })
    }
    //*****************************************
    var rect;

    $(".rect").click(function () {
        rect = $(this);
        //打开选择图片窗口
        $('[name="filetoo"]').click();
    })

    //上传图片
    $('[name="filetoo"]').change(function () {
        var img = $('[name="filetoo"]').val();
        //console.log(img);
        if (img) {
            $.ajax({
                url: '/images/too',
                type: 'POST',
                data: new FormData($('#imgForm')[0]),
                processData: false,
                contentType: false,
                success: function (data) {
                    console.log(data);
                    if (data.status == 1) {
                        imgUrls += data.url + ";";//拿到所有图片的路径
                        rect.before("<div class='col-3 rect'><img src='" + data.url + "'/></div>")
                    } else {
                        $(document).dialog({
                            content: data.msg
                        });
                    }
                }
            });
        }
    });
    //*****************************************
    //***************保存************************
    $('#saveBtn').click(function () {
        console.log(imgUrls);
        if (!user) {
            return;
        } else {
            $.ajax({
                url: "/users/updatepictures",
                type: "PUT",
                data: {id: user.id, pictures: imgUrls},
                success: function (data) {
                    if (data.success) {
                        window.location.reload();
                    }
                }
            })
        }
    });

}